#!/usr/bin/env bash
set -ex

mkdir -p ../results/tables/
mkdir -p ../results/figures/
mkdir -p ../results/for_publication/tables/
mkdir -p ../results/for_publication/figures/

Rscript -e "source('2_classify_political.R', echo=TRUE)"
Rscript -e "source('3_merge_survey.R', echo=TRUE)"
Rscript -e "source('4_descriptive_analysis.R', echo=TRUE)"
Rscript -e "source('5_custom_panels.R', echo=TRUE)"
Rscript -e "source('6_event_study.R', echo=TRUE)"
Rscript -e "source('7_event_study_party_binsR.R', echo=TRUE)"
Rscript -e "source('8_usage_tables.R', echo=TRUE)"
Rscript -e "source('9_weighted_event_study.R', echo=TRUE)"
Rscript -e "source('10_plot_Gtrends.R', echo=TRUE)"
Rscript -e "source('ISSUES_2_classify_political copy.R', echo=TRUE)"
Rscript -e "source('ISSUES_3_merge_survey.R', echo=TRUE)"
Rscript -e "source('ISSUES_4_descriptive_analysis.R', echo=TRUE)"
Rscript -e "source('11_prepare_for_publication.R', echo=TRUE)"

# unnecessary step: convert pdf figures to eps
# bash convert_pdf_to_eps.sh